package jgl.vajra.management.part.order.viewModel;

import java.util.Map;

import jgl.vajra.management.bean.GrabOrdersBean;
import jgl.vajra.management.part.order.contract.GrabDetailsContract;
import jgl.vajra.management.part.order.model.GrabDetailsModel;
import jgl.vajra.management.widget.mvvm.factory.CreateModel;
import jgl.vajra.management.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(GrabDetailsModel.class)
public class GrabDetailsViewModel extends GrabDetailsContract.ViewModel{
    @Override
    public void getGrabOrdersData(Map<String, Object> map) {
        mModel.getGrabOrdersData(map).subscribe(new ProgressObserver<GrabOrdersBean>(true,null) {
            @Override
            public void _onNext(GrabOrdersBean data) {
                mView.returnGrabOrdersData(data);
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }
}
